/**
 * Created by Administrator on 2018/1/8.
 */
function login() {
// console.info("点击了登录");
    var userName = $("#username").val();
// console.info(userName)
    var userPass = $("#password").val();
// console.info(userPass);
    if (userName == "" || userName == null) {
        alert("用户名不能为空");
        return false;
    } else if (userPass == "" || userPass == null) {
        alert("密码不能为空");
        return false;
    }

    $.ajax({
        type: "POST",
        url: "/user/login.do",
        data: {"username":userName,"password":userPass},
        async: false,
        success: function(date) {
            console.log(date);
            if(date.status == 0)
                    window.location.href = "../index.jsp";
                else
                    alert(date.msg);


        },
        error: function(date) {
            alert("服务器繁忙!");
        }
    });


}


function toRegist(){
    window.location.href = "/jsp/regist.jsp";
}